package cn.gp.controller.exception;

/**
 * @ClassName CustomException
 * @Description 客户端异常
 * @Author He_Guoping
 * @Date 2023/5/31 13:02
 * @Version 1.0
 */
public class CustomException extends RuntimeException {
    private Integer code;

    public CustomException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public CustomException(Integer code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
    }

    public CustomException() {
        super();
    }

    public CustomException(Integer code) {
        super();
        this.code = code;
    }

    /**
     * 获取
     * @return code
     */
    public Integer getCode() {
        return code;
    }

    /**
     * 设置
     * @param code
     */
    public void setCode(Integer code) {
        this.code = code;
    }

    public String toString() {
        return "CustomException{code = " + code + "}";
    }
}
